﻿using System.Collections.Generic;
using System.Threading.Tasks;
using NPOI.Util;
using SmartPlant.Model;
using SmartPlant.Model.Biz;

namespace SmartPlant.Services.Interfaces
{
    public interface IInstrumentService
    {
        /// <summary>
        /// Get Instrument from differen scopes (loop,unit)
        /// </summary>
        /// <param name="proId">  Project ID</param>
        /// <param name="scopeId">parent id</param>
        /// <param name="pscope"> pscope == 0 ? "loop" : "unit"</param>
        /// <param name="select"> properties</param>
        /// <param name="orderby"></param>
        /// <returns><see cref="Task"/></returns>
        Task<List<Instruments>> GetInstrumentsAsync(
            decimal proId,
            string sqlWhere,
            string select = "cmpnt_id,cmpnt_name",
            string orderby = "cmpnt_seq,cmpnt_name"
        );
        Task<Instruments> GetInstrumentAsync(decimal proId, string insId);
        Task<RESTfulResult<string>> CreateInstrumentAsync(decimal proId, decimal unitid, decimal loopid, decimal typeid, string cmpntname, decimal copyId = 0);
        Task<bool> UpdateInstrumentAsync(decimal proId, Instruments insItem);
        Task<bool> UpdateUDFAsync(decimal proId, UdfComponent udf);
        Task<bool> DeleteInstrumentAsync(decimal proId, string objid);
        Task<List<ComponentFunctionType>> GetComponentFunctionTypes(
            decimal proId,
            string sqlwhere = "CMPNT_FUNC_TYPE_ID > 0",
            string select = "CMPNT_FUNC_TYPE_ID,CMPNT_FUNC_TYPE_NAME,CMPNT_FUNC_TYPE_DESC,PROC_FUNC_ID",
            string orderby = "PROC_FUNC_ID,CMPNT_FUNC_TYPE_NAME"
        );
    }
}
